package sennetworkserver;

import java.util.Observable;

public class TrafficLight extends Observable {

	public static final int OFF = 0;
	public static final int RED = 1;
	public static final int ORANGE = 2;
	public static final int GREEN = 3;
	
	private int state;
	
	private int laneId;
	
	public TrafficLight(int laneId) {
		this.laneId = laneId;
		state = RED;
	}
	
	@Override
	public void notifyObservers() {
		super.notifyObservers();
	}
	
	public void setState(int state) {
		if (this.state != state)
			setChanged();
		
		this.state = state;
	}
	
	public int getState() {
		return state;
	}
	
	public int getLaneId() {
		return laneId;
	}

}
